class AddNestedBookmarks < ActiveRecord::Migration
  def self.up
    add_column :bookmarks, :parent_id, :integer
    add_column :bookmarks, :lft, :integer
    add_column :bookmarks, :rgt, :integer
    
    Bookmark.update_all('lft = id, rgt = id')
  end

  def self.down
    remove_column :bookmarks, :parent_id
    remove_column :bookmarks, :lft
    remove_column :bookmarks, :rgt
  end
end
